package com.cdtye.itps.cms.controller.origindata;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.itps.cms.dao.origindata.vo.JcjcDetectC1DataVo;
import com.cdtye.itps.cms.service.origindata.JcjcDetectC1DataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

import static com.cdtye.common.webcore.web.AjaxJson.success;

@Api(tags="1c原始数据详情接口")
@Controller
@ResponseBody
@RequestMapping("/detect1cData")
public class JcjcDetectC1DataController {
    @Autowired
    private JcjcDetectC1DataService jcjcDetectC1DataService;

    @ApiOperation(value = "1c原始数据分页查询")
    @PostMapping(value = "/listPage")
    public AjaxJson<IPage<Map<String,Object>>> listPage(@RequestBody JcjcDetectC1DataVo vo){
        return success(jcjcDetectC1DataService.listPage(vo));
    }

    @ApiOperation(value = "导出数据")
    @GetMapping(value = "/exportList")
    public AjaxJson exportList(JcjcDetectC1DataVo vo, HttpServletResponse response){
        jcjcDetectC1DataService.exportC1Data(vo,response);
        return AjaxJson.success();
    }
}
